import request from '@/utils/request'

// 部门管理
const URL_PREFIX = '/dept'

export function getTree(params) {
  return request({
    url: URL_PREFIX + '/getTree',
    method: 'GET',
    params
  })
}

/**
 * 获取详情
 */
export function getInfo(id) {
  return request({
    url: URL_PREFIX + '/' + id,
    method: 'GET'
  })
}

/**
 * 新增
 */
export function add(data) {
  return request({
    url: URL_PREFIX,
    method: 'POST',
    data
  })
}

/**
 * 修改
 */
export function edit(data) {
  return request({
    url: URL_PREFIX,
    method: 'PUT',
    data
  })
}

/**
 * 删除
 */
export function del(data) {
  return request({
    url: URL_PREFIX,
    method: 'DELETE',
    data
  })
}
